Restrucured to app to conform to Dart package layout convention

* moved all Dart code (except the entry point) to lib
* updated tests to load code from packages/