Added testing code. Should probably make QuickCheck instance eventually...