Adding support for multiple temperments.
Adding hopefully comprehensive testing.\nThanks to rxi for the wonderful tester.lua.
First problem caught by the tests fixed.