Script refactor
Removing error table.
Fixing missing return
Merge pull request #3 from martinthomson/rewrite

Script refactor