Make Location objects take less memory.

-Use bitmask for has*** methods.
-Use ThreadLocal for caching intermediate computations
 rather than preallocating memory in every Location

Change-Id: If2fa17bfd59511ec0b809f4b7d7cd8028360c340
2 files changed