Added plugin architecture

added unit tests and test data builders.
Some extra work on reflection