Refactors verification to reduce memory; makes fully compatible with ruby-macaroons