Added from JSON constructor and tests.