cleanup parse.py

make it more importable by splitting definitions and statements