make sure values are stored in the hidden input correctly

This once again removes the Math.random hack for item ids. Ids are used as the value that's returned in the hidden input, so it was causing problems on the backend.

The hack is also no longer necessary to make sure that items stay in the results list after they are selected. I am not sure why that changed, but I added a test to confirm it.