shuffled around the test a bit to make it clearer
it doesn't matter what ind you pass in, since it is always recalcuated so the parameter can be removed
simplifed insert_sid to actually parse the query string, modify the sid, and then encode the querystring again
ILLIAD_SID is configurable and may be longer (or shorter) than 4 characters
insert_sid should still return a url when a url does not have a sid
added functionality to fix improperly encoded ampersands in parameter values
few more docs, and relax parsing of query string after fixing ampersands in case there are other problems