Insert script updated
Moved functions and options into their own files