Port of most linking related code from rails
Sections import control mapping function, flash messages, and minor bugs
Merge pull request #131 from reciprocity/feature/import_base_linking

Map controls to sections on directive import, flash, and fixes.
54315498 Make sure that expected fields in a permissions object are
present, even if the client hadn't originally sent them.