Improved architecture and tests

Added custom framework to wrap application functionality, and extended
tests and test functionality