HttpServer: encapsulate HTTP response status in enum

Or to be more accurate, in a discriminated union. This sum type aims to
capture the possible HTTP response codes and their associated
information in a type-safe way.

Also, give the handler functions a type alias and rely more on type
inference.
HttpServer: check for keep-alive once per loop

Within each iteration of the inner dispatch loop, the value of
keep-alive doesn't change; so call the checker function only once.
Merge pull request #2 from yawaramin/master

Use discriminated union for HTTP response; and check for keep-alive once per loop