Partially done getting tests to work and squashing bugs.