Archives and credentials

Initial archive and credentials work. Missing unit tests at the moment, but manually tested and working.