Added resource and fields tests.
Added more comments, cleaned up a little code, passed tests.
Fixed up more of the tests.