Refactored storage to model the APIs accurately

- Modify getters and setters to return promises.
- Updated the test suite.
- Tested in the browser as well.