Store finished element into local storage.

Fix bugs in data storage functions, now returns the correct result.
Merge pull request #31 from rohitj/michaelize_30_store_finished_elements

Store finished element into local storage.