Revert "refactored some code and add python3 support."

This reverts commit 943895f4d4d48c06f7ea46f21756af7eedc66d0b.
Refactor some codes. Update to v0.3