Refactor mosesController

* Added a nested class to handle moses output connection.