Add support for login plugins. Also misc things.