Refactored code.

+Added success/fail handlers for all the source's actions.
+Added a unified way to get the euid from opts and rec.
+Added a unified way to generate localStorage keys.
*Code refactoring.
*Minor performance improvements.
Merge pull request #1 from DimitrK/master

Refactored code by DimitrK for slimmer unified handling of euids and localStorage keys, completed error and success handling,