api: Server core

This is the integrated OSv API server core. It uses epoll() and a single
thread for accepting and serving connections. HTTP requests are parsed
with Joyent's HTTP Parser library. JSON is parsed and formatted with
Dropbox's JSON library.

The design is very similar to HTTP server in mgmt.git:

  - The server class has an epoll loop that accepts new connections and
    delegates request processing to them.

  - The connection class parses a HTTP request, looks up the associated
    resource, and sends out the resource-generated response.

  - The resource class abstracts anything that can be GET'd or PUT'd
    (only GET is supported for now).

  - The registry class keeps track of available resources in the system.

In future, the registry class will also be used to generate Swagger
"api-docs.json" during runtime which makes it possible to dynamically
add and remove resources from the JSON API.

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
api: OS services

As a proof of concept, this implements "/os/version" API that is
compatible with current JSON API. There's nothing fancy here. It's a
simple wrapper to osv::version() function with some JSON library magic
to serialize the value into proper format.

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
api: HTTP parser library

This is a source import of Joyent's HTTP parser library taken from:

https://github.com/joyent/http-parser

Imported commit is 8d9e5db981b623fffc93657abacdc80270cbee58.

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
api: JSON parser/formatter library

This is a source import of Dropbox's JSON library taken from:

  https://github.com/dropbox/json11

Imported commit is 80578664de72b23992f9ac08b17ae9d336dc1fa9.

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
api: Add to build system

Add API source files to the build system.

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
loader: Start API server on boot

Start up the new API server at port 8080. This really needs to be made
configurable.

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>