Added a bunch more commands (play, stop, pause, terminate, scan, clean) and some optimizations)