Import/export terrain information from/to JSON

Fixes #350