added support for negotiation.
fixed some namespaces and introduced the concept of a mechanism factory.
renaming, refactoring.