Basic planner working. No gaschanges tough

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Started with gas changes. Some index gymnastic still fishy

Signed-off-by: Robert C. Helling <helling@atdotde.de>