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.