Add Python 3 compatibility
Minor refactoring
Update install script