Re-aranged the code a bit so that the jokeview is in a separate js file.