Fixes for #259 and #260

#259: TSDB.collectStats(StatsCollector) will relay collect stats to plugin instances.
#260: Fix for UIDMeta.getStorageJSON() which fails when custom is not null.