Make output script more readable
Change test by according last changes in ormtool
Make some methods is private, use dirty hack for their testing
Many small optimizations and improvements