Refactoring MainFile to prepare for testing automation

Partially addresses #216 so that we can have a way to setup servers programmatically. Moved stdin interactive into `OTServer.cpp` because this is likely not how we want things going forward.

I have also added MainFile.hpp to the SWIG generated APIs.

Some minor cleanup as well as I looked through the code.