Moved sidebar processing/display into macros.j2

Also abstracted it a bit. See drslib_sidebar.j2 for sample