Refactor handle_presence

TODO: dialyze, test, refactor handle_{iq,message}