new tests and common code

Some of the codebase didn't show up well on the mac.  I'm still
experimenting.