Feature/scratchpad

The complete implementation of a scratchpad,  as mentioned in #28. Some refactoring of this code would be nice.