Make slight style changes

$var for jQuery variables, conditional operator improvements, cache
$this
Merge pull request #694 from mc10/style-fixes

Make slight style changes