Improve type safety and efficiency.

The major change is to make bind take a function of a 'UserDofs' type parameter onto the value to bind, and evaluate return a function
of UserDofs. This means that when performing numerous concurrent evaluates with the same variables bound to different values, as used
to export models, there is no need to repeatedly compute what variables to bind where.
Minor bugfixes so that the exported simplified FieldML is produced efficiently and is valid