Refs #60, migrates API tests to new testing design.

I have added an abstract Test class, and classes that extend this will implement setup(), test(), and teardown() functions. All of the testing code has been moved out of the api-tests.class.php TestEnvironment file and now each test has its own file and class. The code is more organized and readable. The other test environments should be migrated to this framework at some point as well; at least unit tests.