Reformats blocks.py.
Rewrites blocks into more pythonic classes.