Changed line endings, restructured code for future plugins.
Merge branch 'plugins' into devel