Adding initial code for Library category. Adding initial unit tests for User and Library categories. Making some changes to test code to add some reusable functions - not used everywhere yet.

I hope this makes sense - I have imposed some structure to the test code in the new test files which has reduced the total code. I could roll this out more generally if you were in agreement.