General upgrades.

1. seperated python code from vim code.
2. many improvements.