Improved validation.
Almost finished, tests missing and also some syntax check.
Added minimal error handling and updated version number.