Added localforate support and fixed bugs in persist

Added a separate file to add local forage support.
There is a seperate