store catalog item id, minor tidies and lots of tests including osgi versions

replaces #274 (incorporates it all, with conflicts fixed, and then some tweaks)

@neykov looking forward to your feedback