Attrs: Restore ability to pass array to jQuery#val

Thanks @gibson042
Tests: Fix code style issues

(cherry-picked from a2250b0f4c157745b8cd8ac1247c6084882c500f)