Based on Google Notebook and Tim's php-Notepad.