added base-sidebar template; numerous bug fixes