New data format (fix #515)

Implementation of the data formats described in #515.