Added many new unit tests.

Updated many functions whose tolerance was template based, is not an
option parameter.

Many templates now instantiate correctly without need for explicit definition.

Consider moving unittests into the main file, instead of being separate.