The most popular justifications are from lancashire dialect as a way of putting the inhabitants down, the transatlantic trade links ( being the poorer relation of Uncle Sam), or a linguistic quirk from the celtic for 'bog dweller'.
Regardless of the truth, it was adopted proudly within the city and elsewhere, and was common parlance about someone from these parts. I'll be exploring this more in my book of course, which you'll have to buy to get all the nuts and bolts.
The spelling by the way, does vary in different accounts. Which is 'correct' would depend on the real derivation of the term, which we will never definitively know. But as I like you, I'll give you a hint as to my interpretation tomorrow.