Asynchronous operations

**Stores**

Adding a new function to the store called `query` which is responsible for
* Ensuring only one query for a given key occurs at any one time
* Executing a query against the local cache
* Executing a function to retrieve data if its not in the local cache
* Returning a object, ``StoreQuery`` that represents the lifecycle of the query
```
Store#query(key, localQuery, remoteQuery) -> StoreQuery
```
``StoreQuery`` has a ``status`` which can be pending, error or done. Like stores, there is an ``addChangeListener`` which allows you to register a callback when the status of the query changes.

If the ``StoreQuery`` fails, you can see why by accessing ``query.error``. If the query is successful, the result is accessible by accessing ``query.result``.

Only one query per key can be pending at any one time. While a query for a given key is in progress, invoking ``Store#query`` with that key will return the in progress query. This is to avoid making multiple queries unnecessarily. The key is unlocked once its associated query has completed successfully or failed.

If the local query returns something other than null or undefined then the ``StoreQuery`` moves to the successful state and the result is available in ``StoreQuery#result``. If an error is thrown within the local query, the ``StoreQuery`` moves to the failed state and the thrown error is available in ``StoreQuery#error``

If the local query returns null or undefined then the remote query is executed. Once the remote query completes, the local query is re-executed. If the local query now returns something other that null or undefined then the ``StoreQuery`` moves to the successful state and the result is available in ``StoreQuery#result``. If the local query returns null or undefined then the ``StoreQuery`` moves to the failed state and ``StoreQuery#error`` will return the error "Not found". If an error is thrown within the remote query, the ``StoreQuery`` moves to the failed state and the thrown error is available in ``StoreQuery#error``.

If the remote query returns a promise then the completion of the remote query will be delayed until the promise has resolved. 

```
var FooStore = Marty.createStore({
  getFoo: function (id) {
    return this.query(id, getFromCache, getFromServer);

    function getFromCache() {
      return this.state.get(id);
    }

    function getFromServer() {
      return FooAPI.getFoo(id);
    }
  }
});
```

If you are using a state mixin and the state contains a ``StoreQuery``, the mixin will automatically add a change listener and update the components when the query status changes.

**Action creators**

Actions are responsible for coordinating state mutations. Actions can only mutate local state but have the potential to mutate remote state. It is also common to do an optimistic local mutation and then deal with aliures later on.
```
var UserActionCreators = Marty.createActionCreators({
  saveUser: function (user) {
     var addUser = this.dispatch(user);
     return UserAPI.saveUser(user).error(addUser.rollback);
  }
})
```
An actions type is defined by ``ActionCreator#getActionType(functionName)``. The default strategy is to upper case and separate using underscores, so ``saveUser`` becomes ``SAVE_USER``. You can override ``getActionType`` or choose a specific action type by specifying it as the first element of an array
```
var UserActionCreators = Marty.createActionCreators({
  saveUser: ['FOO_BAR', function (user) {
     var addUser = this.dispatch(user);
     return UserAPI.saveUser(user).error(addUser.rollback);
  }
})
```
Every action creator function will return an **action token**. You can pass this token to ``Marty.getAction(actionToken)`` to get the status of an action. The state mixin automatically listens to the action store (unless you set ``listenToActions: false``) but will only update the views state if you return an action from ``getState`` which is the action that just changed

```
Marty.createStateMixin({
  getState: function () {
    return {
      someAction: Marty.getAction(this.state.someActionToken)
    }
  }
})
```
You can listen for changes to actions by registering handlers for ``ACTION_STARTING``, ``ACTION_ERROR`` and  ``ACTION_DONE``.

If you return a promise from an action creator, the action will wait for the promise to complete before updating the action status.

**To do**
* [x] Create StoreQuery
* [x] Add locking to ``Store#query``
* [x] Add local queries
* [x] State mixin should listen to store queries as they change
* [x] Add remote queries (including returning actions)
* [x] Listen to actions
* [x] Documentation