Add Selector API. Merges #297, Closes #294
Fix javadoc errors