handle config changes in HTTP api

If the http config changes, the new http handlers will get the new
config optins. If the protocol changes, the handler will automatically
be restarted (ie http -> https).

While I'm here refactor a little the code to make it reusable.

related to #11.
load HTTP config ftom the ini file