Adding IbPy module, re-organizing code for unit testing