Switch to using object-oriented phrase templating

@quavmo, please check that this doesn't break existing functionality. We should really have some specs!