Catch up with latest changes on master, minor refactoring.
Add simple key-value store api.
Display portal message instead of 404 when attempting to download missing file.