Implemented the same optimizations as memononen/recastnavigation#13
Cleaned up CompactSpanReference and added a "Null" constant.