Render by slices with web workers

Plus a lot of cleanup.