avoid sys.error unless error condition is truly fatal
fix some random unnecessary uses of java.lang.Integer
minor cleanup and update comment
extract methods to appease Scalastyle
Merge pull request #593 from NetLogo/avoid-boxing-ints

cleanups around java.lang.Integer and sys.error