local variables considered harmful

Consider the following function:

    func() {
      local -n ref_var=$1
      local foo="Oops"
      ref_var="Gotcha"
    }
    foo="Fail"
    func foo
    echo $foo

    => Fail

When nameref variables are involved, local variables can introduce
unexpected and non-obvious bugs like the above. The biggest problem is
that the caller cannot predict -- and in principle, should never have to
care about -- what local variables the called function defines.

Therefore, strictly speaking, any function that uses nameref variables
to assign external variables must not set any local variables,
*including* nameref variables -- a perfect paradox.

As such, artificial variable naming conventions have to be established.
But before we think of that, consider the following principles:

 - Always prefer positional parameters over local variables.
 - Always prefer bash ALL_CAPS variables over local variables.
 - Define as few local variables as possible.
 - Use sub-shells, sub-functions, or external programs to reduce
   namespace pollution.

These are good practices when writing functions that use nameref
variables. The absolutely necessary naming conventions are:

 - Prefix with `ref_` if and only if it's a nameref variables.
 - Prefix with `noref_` if and only if it's a non-nameref variable that
   must never be referenced by a nameref variable. Non-nameref local
   variables defined inside the same function as a nameref variable are
   such variables.

The noteworthy patterns and changes in this commit are:

1. In an effort to reduce local variables, the idiom

       IFS=' ' read -r a b c <<< "$foo"

   is replaced with

       IFS=' '; set -- $foo

   because positional parameters are the best.

2. Similarly, the idiom

       while IFS=' ' read -r line; do ... $line ...; done

   is replaced with

       while IFS=' ' read -r REPLY; do ... $REPLY ...; done

   because bash ALL_CAPS variables are the second best.

3. The `IFS='...'; set -- ...` trick is applied in some more places,
   and `"$*"` turns out to be really handy. Positional parameters rock.

4. The use of `awk` in xwininfo_get_window_by_ref().

5. Several global variables are renamed as follows:

       rootw -> root_w
       rooth -> root_h
       w     -> rect_w
       h     -> rect_h
       _x    -> rect_x
       _y    -> rect_y
       x_    -> rect_X
       y_    -> rect_Y