added implicit begin, improved test coverage
reader error handling improved, added exit syntax