Added !msg functionality and moved !upload to using prepared statement as well as a few cleanups in the code. Fixes #19