Added caches and distance returns
Merge remote-tracking branch 'upstream/master'
Merge pull request #11 from kt36/master

Database finished