Scripting update

Adds better support for scripts and runnables, but does not fully
implement the former.

I should probably change that.