Initial commit.

Imports from webarchiveaccess repo code and small refactoring.