Satisfy jshint checking.
Various updates.
Major refactor.