Split web.go into multiple files.

This refactor aims to make the project easier to understand and maintain.
Replace ad-hoc HTTP server with the one from httptest.

WIP on issue #1.
Change tests to run without a HTTP server.
Remove HTTP server from tests.

Closes #1.