Add app.ready() and Model ready hooks

@bajtos @raymondfeng @fabien @kraman 

This adds a set of ready hooks to `Model` classes. Override these hooks to implement custom behavior that depends on your app being bootstrapped:

 - models attached to datasources, methods mixed in
 - relations, remoting, and other metadata defined
 - boot scripts run, `loopback-boot` complete
 - etc.

## Docs

**Do not call this method** if you are using `loopback-boot` to bootstrap your application.
`loopback-boot` will call this method for you! Otherwise you must call `app.ready()` to run
the `Model.ready()` hooks.

Calling `ready()` will call `ready()` on all models attached to the `app`. Override
the `ready()` method on a `Model` class to ensure you have access to a bootstrapped application.

```js
module.exports = function(MyModel) {
  MyModel.setup = function() {
    // setup is called when a model is extended
    // you must call `base.setup()` to extend the base class properly
    this.base.setup();

    // add or remove remote methods and otherwise modify the `Model`
    this.remoteMethod('myMethod');
  }

  MyModel.beforeReady = function(app, cb) {
    // async setup, runs after all models are `setup()`
    // and before `ready()` is called
    setTimeout(cb, 100);
  }

  MyModel.ready = function(app) {
    // MyModel and other classes can be used
    // you should not modify any classes in this method
    console.log(this.sharedClass.methods());
  }
}
```

Please use a more descriptive flag than a number. When `called` was `2` on the build-server, how are you going to tell what went wrong?

A better solution is to use an array and push a string in every callback. That way you can also verify the order of calls, which is important too!

```
expect(called).to.eql(['TestModel.beforeReady', 'TestModel.ready', 'ready callback'])
```