Optimizes files serving, adds http ranges support.
Fixes #359.