Revert "remove memoize for get_master_header subroutine and make it a transient attribute instead"

This reverts commit 9c36e25bccb852000c8c2e4b47f7ca5e5a2c56d8.
remove memoize for get_master_header subroutine and make it a transient attribute instead

- This version dereferences the return value so that none of the subroutine
  calls have to be changed.