Added unit tests and fixed method only returning part of the expected string

Firstly I added unit tests to compare the categories output with the expected string using PHPs `hash_hmac` function. It was found that some of the methods would return shortened strings, so altered the hasing method.