Modular text completion framework