Bugfix: Moved 3rd party code used in tests into tests folder. Added more documentation.