Major refactor and tests added

* Refactor topsy helpers
* Add tests for each helper
* Move build to executable