Book subcategory remapping

Implements fix for #1724

Also adds support for usage of reallymyownsettings.php in install.php (which I think already works for the refactor branch, but I couldn't get it to work on master).
I split it in two commits so you can cherry-pick what you like.