some debugging and tests, minor cleanup
better debug logging for tests
scaling, not flipping (negative scale) implemented
flipping WIP