cleanup, add docs
more jshinting