Reorder tests.

Move functional tests to src/test/groovy/.../func folder.
Move api tests to src/test/groovy/.../api folder.