Move hamcrest library to test scope

I noticed the hamcrest library was seeping into the dependencies. I have added the test scope to the dependency of the hamcrest library.