Move tests to root directory
Fix broken tests and use basic regexp testing
Add ability to test via functions