Convert FieldPluginManager to generic and add tests