Add tests

Ready to merge.