Scanline optimizations, algorithm optimizations, more test cases