Do not automatically flush layers. Add flush() function. Flush automatically on sync.
Improve scroll handling by paying attention to scroll amount.