Documentationified the add data function.
Use an anonymous function in the quit call in order to cut down on code-duplication.
Added the quit function.