Add events to the app lifecycle

Also, move plugin initialization up to allow plugin routes and
middlewares to override the default ones.
Allow overriding the monitor HTTP options for API requests
Add basic authentication plugin

Closes #111, #22.
Plugins do not need to require the config module...

...since the current configuration is passed as parameter to the
`init()` methods
Merge pull request #166 from fzaninotto/basicAuth

[WIP] Add basic authentication plugin