Implemented formatting; wrote a few full integration tests