cleanup *_to_dict
test for blocks.to_dict w/ code
cleanup and pep8