Added tests for new-from-template.

Also added copy method and tests.
Refactored duplicate sanity-checking code.

Now in static method.