Rebuild library for speed

This also includes a fix to the sRGB conversion algorithm and a more elaborate test suite based on Mocha/Chai.
(None of the new tests pass :frowning:)