Text this: A modular construction of type theories