All you need to do to extend is take a look at the extended.js file. Extensions are based on callbacks.
The file also includes a few examples to follow. The double free detecton and overlap detecetion showed in the demo are made as extension functionallites.
TO DO: Explaining this section better (Although it doesn't really need much explination)