fix jshint issues for sms

mostly globals and exported, but also some somewhat bigger changes in some parts
(esp wbmp).