Added scripts from Chasm

These are the scripts from chasm that I could find.
I have done some refactoring to make it more easily
extendable to other projects.