Correct mac creation.

base64.encodestring adds a trailing newline to strings it creates which we don't want, so use base64.b64encode instead.