Adding a tests project. Refactoring of definitionfields methods for maki...

...ng them testable. Adding a test for AddDefinitionField testing that we don't move a definitionfield instead of creating a new one.