(TWILL-76) Improve Location class be able to return LocationFactory

See https://issues.apache.org/jira/browse/TWILL-76 for details.