Move translation factory to utils

So that it can be used by plugins.