There are some books you may want to look for:
"Merry Songs and Ballads Prior to the Year 1800", five volumes, edited by John S. Farmer, Cooper Square Publishers, 1964. This is a wonderful collection of dirty songs, mostly from the Renaissance. No music given, but there are great titles, like "Thomas You Cannot" (1603), "My Thing is My Own" (1707), or "The Merrie Ballad of Nash His Dildo" (1601)
"The Bqwdy Beautiful Book", compiled by Molly Bennett, 1992. Email me and I'll give you the address that I have for her. This is a collection Renn Faire / SCA favorites. Melodies included.
"Roll Me Over", Edited by Harry Babad, Oak Publications, 1972. Lots of good songs, all with music, divded into sections of Renaissance songs, Scots songs, Irish songs, songs of the sea, etc.
"The Dirty Song Book", by Jerry Silverman, Stein and Day Publishers,1982. Lots more songs, all with music.
As for the other questions, many songs can be gender switched with interesting results. Most need some degree of rewriting if you do this, but it's fun and educational. My wife and I used to sometimes switch roles ourselves, instead of changing the song -- I would take the women's lines and she would take the men's. It added to the humor to have her stamping and spitting, and me cooing and primping. Well, if you're going to do this kind of music I guess you have to play to some fairly broad sterotypes.
For the lyrics with no music, you can find melodies that you already know that fit the words -- there are only about 3 or 4 rhythm and rhyme schemes in most traditional music, maybe less in bawdy songs. Or you can grab dance tunes, slow them down a bit, and use them for songs. Most lyrics will fit either a jig or a reel.