Check whether a plugin is valid before adding a node

While we're at it, rename the plugins directory and clean up some unused code.

Fixes #2.