Branch gsoc 2

Things fixed:-
 -Move to DB instead of storing on file.
 -Fix saving on orientation change.