Added API to manipulate selection.

Fixes #34.