Unit tests

Added lots of unit tests in ```tests/unit/```
Moved the existing functional tests into ```tests/functional/```
Travis now only runs the unit tests. Functional tests can be run manually
Closes #44.