rename StateMetadata -> Metadata
add comments/style changes to state package