Added support for clear and clearall commands
First working prototype
Need to fix application 'Unable to write' error