Removed chart margins

Speeded up text drawing (entire chart is no longer redrawn each mouse move)

Guarded against errors from processes being killed during chart creation

Made text render in a box for better visibility

Cleaned up code, added comments