Better optimization for advanced compilation mode
More performance and size optimizations

Not using Math.max and Math.min increases performance, and by
using ol.extent functions instead of RTree's rectangle
structures and calculations we can get rid of several functions.
Making docs more clear
Porting tests from http://github.com/imbcmdth/RTree/

Also fixes some issues that were revealed by the new tests.