Multiple enhancements

Hello, 

I've put together a bunch of enhancements from other forks and added SSL support on top.

I'm planning to add a few other authentication options, but in the meantime this is certain to be of some use...