Allow widget getAttribute to take an optional selector

Fixes #156