Http server: Add a helper function in the reply to add a header

This adds a helper function in the reply object that adds a header to
the list of headers.

Reviewed-by: Tomasz Grabiec <tgrabiec@gmail.com>
Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
Http Server: Support optional Access-Control-Allow-Origin header

When the GUI and API are not placed on the same server it is useful to
have the Access-Control-Allow-Origin header set to *.

This adds a command line flag option to set the header.

The server now passes its configuration to the request handler.
When the flag is set, the request adds the access control header.

Reviewed-by: Tomasz Grabiec <tgrabiec@gmail.com>
Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
Http server: Expose ifconfig infromation in the API

This adds the equivalent of the ifconfig information to the API.
/network/ifconfig will return a list of all the interfaces with their
configuration and data.
To check a specific interface (ie. lo0) do:
/network/ifconfig/lo0

Interfaces information returns with timestamp. Currently all interfaces
in a single call have the same timestamp, we assume that the
difference is neglegtable, but API support specific
timestamp per interface.

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
Http server: Add recursive operation for directories

Directory deletion should support recursive deletion to support deleting
all of its sub content.

This patch adds both directory recursive deletion and modify directory
creation to be aligned with hadoop HDFS:
"Make the given file and all non-existent parents into directories. Has
the semantics of Unix 'mkdir -p'. Existence of the directory hierarchy
is not an error."

Reviewed-by: Tomasz Grabiec <tgrabiec@gmail.com>
Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>