Added the factory and refactored some of the code to better coding standards.Also added a public constructor to each message in stead of private constructors. These public constructors are called fromt he message factory