extracted JavaScript into a file, simplyfied API for setting and removing fragment parameters