Call library methods only when ready

Defers actual library method calls until driver is loaded and ready. This renders the `ready()` calls unnecessary when using with RequireJS.

```javascript
define(['localforage'], function(localforage) {
    // As a callback:
    localforage.ready(function() {
        localforage.setItem('mykey', 'myvalue', console.log);
    });

    // With a Promise:
    localforage.ready().then(function() {
        localforage.setItem('mykey', 'myvalue', console.log);
    });
});
```

The above RequireJS example from the readme could simply be the following in both cases:

```javascript
define(['localforage'], function(localforage) {
    localforage.setItem('mykey', 'myvalue', console.log);
});
```
Ah, that explanation is perfect! That's what I thought but wasn't quite sure. Yes, if you could update the comments with your explanation here that would be great. 
--
tofumatt (Sent from mobile)

On July 21, 2014 4:47:22 AM EDT, Beng Hee Eu <notifications@github.com> wrote:
>> @@ -0,0 +1,19 @@
>> +/* global beforeEach:true */
>> +var mocha = this.mocha;
>> +
>> +mocha.setup('bdd');
>> +
>> +beforeEach(function(done) {
>
>It isn't very easy to test the API method stubs inserted by
>`callWhenReady`, since they are replaced by the driver as soon as it
>loads. To ensure that they work when the drivers are loaded
>asynchronously, this runs the entire test suite (except for config
>tests), but with localforage reloaded before each test, so that it
>would be initialized again.
>
>This ensures that the synchronous parts of localforage initialization
>and the API calls in the tests occur first in every test, such that the
>`callWhenReady` API method stubs are called before RequireJS
>asynchronously loads the drivers that replace them.
>
>Is that sufficiently clear? If so I'll change the comments to summarize
>the above.
>
>---
>Reply to this email directly or view it on GitHub:
>https://github.com/mozilla/localForage/pull/212/files#r15159105