factored out _AppHash so we can share it with terms and then added
strict application for terms.