Add convenient ways to load/save a session-backed preferences object.

Make this something we can mix into any controller with a generic
pref object.
Extracted generic controller trait and mixin it into the Portal controller