added tests to build file. And refactored.
Merge branch 'develop' of https://github.com/JNCC-dev-team/catalogue into develop