Add nosetest bin script
Add some unittests
Minor PEP8 fixes