V1.0 script rewrite

Rewritten script. Notifications should now work when receiving a
message and the messages window is not active. Currently an error will
be received when sending a message