Initial import and refactoring of httpsig