various bugfixes, added jquerycookie to do some first time settings