backport from epics: break down menu generating code

Conflicts:

	app/controllers/rb_master_backlogs_controller.rb
correct "new story" menu for shared releases