[WIP] Refactor plugin system

This supersedes #1335, using funcrefs instead of autocommands to implement providers(it is cleaner and requires less changes).

Good with a concrete example :+1:. But this should be `"<afile>"` ?