Move plugin base functions into an include file
Improve comments
Unify style
Merge pull request #9 from Rainyan/rain-dev

Rain dev