migrate to Maven, lots of refactoring

The biggest change is that this commit migrates the code to a Maven 3
project. This should make it easier for people to use since it doesn't
assume they're using any specific IDE. A whole lot of things have been
refactored, I'm actually having trouble figuring out all the changes I
made due to the files all moving. One new feature is that SASL is now
supported (auth plain only).