Scripts now loadable/savable

It is now possible to load/save user-defined scripts.
Added controls for ids uniqueness.