More refactoring, fixes and switched to YAML for metadata
Use Go Templates