Documentation and cleanup for the plugins API