[WFLY-1300] Add optional dependencies for JMX and the mail API.

Also additional commit to upgrade log4j-jboss-logmanager.