run hooks through template allowing for dynamic contexting in pre/post hooks
updating with tests for context and fixed issue where variable wasnt being set correctly