Some fixes to make JSLint happy amongst others

1. Defined checkNode function above wrap function
2. Else is implicit when preceding code block ends with a return, so has been removed (checkNode function)
3. Renamed wrap variable in wrap function to span (avoid confusion)
4. checkNode ran twice for each node if eligible: it returns false if ineligible so simply checking for that value suffices (Outer loop, wrap function)

Other stuff:
typeof doesn't need parentheses around the variable; removed
various other bits of linting; JSLint now just grumbles about undefined globals

Running this on a span does seem to work, see: http://labs.wyverex.com/lettering/ for an example, hence I put that tag back in the list.