Added categories.go and associated test

- This is an initial implementation (still have some pieces to go)
constructAttributeFields now performs error checking
The error in general_test.go is now marked as a logging event