Added unit tests for Pattern management.
Introduced utility methods for factory API.
Handled strange XML Marshalling syndrome between OSs.