Merge pull request #48 from stuart-warren/next

Next
almost finished only allowing enum fieldnames
bugfix
bugfixes, mainly due to trying out PMD and findbugs
Merge pull request #50 from stuart-warren/pmd

bugfixes, mainly due to trying out PMD and findbugs
merged bug fixes from PMD, completed more work on enum fields