Basic metadata implementation. This nukes a quite significant amount of code, some of which will be readded w.r.t metadata instead of attributes.