To at least get constant time compare. Also fix incorrect parsing of the creds (were incorrectly stripped). Also add unit tests.