Move all test code to tests folder

Fixes #32