Got rid of some of the panics.  Replaced some of the less idiomatic go code.