messaging module suppports end at content script

Added new option "endAtPage: boolean" to specify whether
the communication channel ends at the page or content script.

If it does not end at the page, ie endAtPage:false, then
the global "extension" object is defined in the content script.