More complete tests of dynamic_t's equality operator.
Reduce copy-paste a little.
Remove unnecessary checks.

These tests test the equality and inequality operators, not the constructors.
And some more unnecessary checks are removed.
Some tests for dynamic_t::apply and a fixed bug there.
More tests for dynamic_t::apply.
And even more tests for dynamic_t::apply.
Reduce number of dynamic_t::apply overloads.