much improved distance measuring logic, improves performance on mobile and fixes some crashes
delay client capability test until initialization phase
make view distance configurable #527