Fix copy/paste errors, mapping arcsin and arctan to arccos.
Allow recording of static equations and do not crash for models without
differential equations.
Test the mathematical functions
Make sure to avoid circular dependencies. Make the clear() function more
robust.