Conform to "use strict"; and moved helper functions out of main function since they really aren't needed there

To conform to strict mode "var entryHtml" should be re-declared each time the function is called. 
Not declaring was also just making a new variable each call to the functions anyway because after the call it falls out of scope and is gc'd/overwritten each time anyway. 
So being explicit about creating a new variable is just conform to strict mode if ever used or needed in the future.