Implemented new plugin lifecycle stages and behavior

1. Construct
2. load
3. init
4. run

also fixed some failing tests.