Bug #1063

- Fixed bug #1063, so that numeric UDA fields are now sortable (thanks to Max
  Muller).
Unit Tests

- Added template.t as an example for all new unit tests.