Moved all private methods into modules. Created TermiteCore class to handle common functions.