Moved the test code into the API
Added testing docs