Resource loading performance improvements

This patch reimplements ConstrainedDataStream to use the lowest level file API available on the platform, and implements light weight custom buffering to improve performance of loading data from disk.