Added plugin system (fixes #5)