Factor out sidebar entry construction
Factor out sidebar entry construction

This makes it possible to reuse this logic in other modules as well,
preventing code duplication. While at it, move additional_sidebar
merging before the other entries (additional entries should go first,
since the other entries are mostly dev-only etc).

Patch by: Sverre Rabbelier

--HG--
extra : convert_revision : svn%3A32761e7d-7263-4528-b7be-7235b26367ec/trunk%401287

rhyolight/nupic.son,rhyolight/nupic.son,rhyolight/nupic.son