Replace metadata dict with a  type

As discussed in #33.