Add tests.

Please don't merge yet.