differentiator: visitor-{print,latex}: use automatically-sized brackets in LaTeX output.
util: fix usage of boost in any_isa().

Boost documentation states that boost::any::type() returns a std::type_info
object, so use plain typeid() instead of boost::<...>.type_info() which is
apparently an implementation detail.
differentiator: store child subtrees in a sorted container.

This way we allow comparing subtrees in O(n) at the expense of inserting a child
in O(n*logn) instead of O(1).

Note that insertion of a subtree is O(n*logn) instead of expected O(logn) because
each comparison still takes O(n).

This also triggered a rewrite of simplification logic -- it became possible to
use a "subtree -> multiplier" map to reduce similar terms instead of comparing
each to each in O(n^2).

Also, the "optimize" visitor has been removed because divisors are now always
stored after multipliers, and it is easy to tweak output engines to print
multiplication-division nodes as fractions without rearranging nodes themselves.
(This has not been done yet.)