consolidate some python 2/3 compatibility code
install scripts under bin via setup.py (#555)
more python 3 compatibility fixes, especially to tests (#544)