add selectObject/unselectObject method to API, for text layer

Also add corresponding example.