Script API modifications

Will be mainly based on Entity references now being a full userdata object.