Refactor metadata class out of plugin.rb