Implement brick rotation, add tests.