Refactor cascade() and fix cascade_with_cached_declarations()

* Expand the apply() and apply_cached() templates. Their two invocations each were different enough that this improves readability IMO.
* Create computed::Context from inherited and cascaded values rather than computed value, as much as possible.
* Centralize this creation rather than making it per-property, making 'needed_for_context' not needed anymore.
* Pass a context to cascade_with_cached_declarations() rather than duplicate the creation code.

@pcwalton r? Does this hurt the optimization introduced in 0fa0940ce9f043d19036894dc4349f9a4b2767aa?

This is mostly about nicer-looking code. The only thing that was wrong ([`apply_cached(priority)` instead of `apply_cached(needed_for_context)`](https://github.com/mozilla/servo/pull/1644#discussion_r9772133)) could be fixed with a much shorted diff.