Fix bugs with Random button

URL history now preserved (e.g. hitting back after multiple Random
clicks will take the user to the correct pages)
Works now even if there's a commander entered into the search box.