Applied Moodle coding style, moved all tests into tests/ directory, got tests passing under Moodle's PHPUnit test framework