Use a modified version of jquery's serialize fn