Revert "coverity#704575 et al.  and clean-up."

This reverts commit 753eeac8a641d70ad0c44bb15fa8949ac991f5d9, which added bogus

  if (... != 0)

checks after dynamic_casts that cannot fail, making the code now look as if it
was expected that those casts can fail and the code is prepared to handle it
(which it is not).  Silencing the false coverity reports will be addressed in a
follow-up commit.

(That commit unfortunately mixed those changes with mass cosmetic changes.)
Replace "known-good" dynamic_casts with static_casts

...it avoids false warnings about unchecked dynamic_cast results from static
code analyzers, and potentially makes the code a little faster, too.  (Most of
these dynamic_casts were kind of a leftover from a very early design that
dispateched on Node type via dynamic_cast instead of a Node::Kind, but which was
much too slow.)

Change-Id: I8db08a1c35783f8ea6c51eed55b11faa2d958807
bool improvements

Change-Id: I5e597c32bf6a2c44fe3b3dc1d67ac0202d556387