Feature/scripting cleanup (In progress, Please keep branch)

Some fixes to the scripting adaptors. Intermediate merge, as some of the problems where chased to the engine and the ssh adaptor.

(Please keep this branch for now)