Completed hook interface for plugins
Don't use indexOf directory for comparing strings
added E2E spec for plugin interface