[REFACTOR] Move translate code into its own file

As @techninja and I have noted, the translate code is starting to get
large, and with the mode translation code it will get even larger. This
moves it into a new file, making it a little bit more readable in the
process.