wrote test case for add plan. plus abit other refactoring

Signed-off-by: Nicholas Lum <nicholaslum444@hotmail.com>
engine can now add plans. test cases updated

Signed-off-by: Nicholas Lum <nicholaslum444@hotmail.com>