Several improvements and added the ability to unregister MBeans when the
application unloads.