Rename paragraph.py to format.py and add region formatting methods from editor.py. Add tests for the latter.