pep8 and test related changes

code now passes pep8, nose test, and npm javascript.