Refactor addListeners function & improve accuracy

I reused some of the code from messageList.js & moved the main processing
outside of the onMessage listener. The function now ignores sigs - it will only
submit quotes if they exist within the message content. I'm still a bit unsure of
the while loop, but it hasn't caused any problems yet.