Add base classes for collections and JSON translators

Add new template base class Collection (StyleCollection,
SnippetCollection) and JsonTranslator (JsonSnippetTranslator).