Refactor tests

* Refactor tests so they use the new TestCases
* Add PHPDocs
* Update docs