Merge working branch into beta

Things fixed:-
- Switch over to using DB.
- Fix saving on orientation change.