trq-1810 refactored address caching to be more widely used and cleaner. Also fixed a few unit tests.