Fixes Issue #5.
Added validation before class file writing.
Merge pull request #8 from DanielGibbsNZ/master

Fixes Issue #5.