Cleanup, removing deprecated code

* Switched to Apache Commons Base64 encoder (the Sun encoder is deprecated)
* Added trailing semicolon to the charset declaration.
* Making whitespace uniform, with 2-space indentation.