Sbt sample app modifications

I had to modify the sbt.sample.app classes because they were not testable as they were. 

1. Extract from main method into init, destroy and a main testing method.

2. Using the ClassLoader in the tests instead of the previous readFile, as reading files would not have worked once they were packaged in jars. 

3. Posting to streams should take a template, which is provided by the test.