New archive module

This is the same as #105, with a few suggestions and unittests implemented.