Code style cleanup
Low level testing of plugin copy
Always retrieve the new instance from the DB when copy a plugin
Fix number of queries