Implemented JMS stuff, reformatted code