moved the extraction of data and snitt calculations to it's own functions and added comments

Because of some fuck up in the git diff (probably my fault) it's also the change of replacing listifying the subjects list with an tuplify member function of the Subject class and using that in the template: result.html instead.
added tests to the working functions of this app. Also added some test data to use in the tests.