Import unit tests for TestCase from YUI

The tests are passing. (Building and running on top of your WIP + the commits I made to fix the build)