Enhanced plugin

Added more error checking.
Added encoding for title and message.
Added support for priorities.