[#1116] Using $.trim in placeholder logic

The biggest change lies with setPlaceholder and taking out a
significant chunk of logic. But by this time `getPlaceholder()`
should have determined if we ought to show a placeholder at all.