Add tests

A stab at some automated tests