More work on script engine

DO NOT USE YET!!!!