Add MACContext and switch HMAC and CMAC to use it.

Fixes #1319.

Thoughts?