trim: Add a new --trim-spec option for fine-grained trimming

This has two benefits:

1. In cases where the dependency analysis goes wrong, using the --trim-spec
   option can help identify which portion of the code is misbehaving, (and
   allows the user to still get some trim benefit by avoiding the broken
   code).

2. The implementation of this change breaks the analysis code up into several
   more fine-grained functions, so it should be easier to review and maintain.
trim: Trim swapbuffers calls when --trim-spec=drawing

Previously, the SwapBuffers calls were only getting trimmed if
--trim-spec included "no-side-effects". It was counter-intuitive that
a trim-spec of "drawing" alone would leave all the SwapBuffers calls
in place. So catch them under this trim-spec as well.