Optimized chunk loader

Fixes #1486