Backend changes for issue #99.

This should be all the backend changes required. Reading/writing of new
settings tested. Sorting works fine using default and other branches. If
an invalid branch is given, a sensible error message is produced.

Still need to update settings UI for editing the branch.
UI changes for issue #99.

That should be it. Tested and working for me.