Slowly add tests back.

Started basically from scratch to make headway on the testing situation.
Going to be messy for a few more commits until things settle back down
and enough progress is made to solidify the codebase.