externalize plugin support, integrate resolve-dep, and add tests for loading plugins

see issue #326 and pull #325.