Merge "Text selection refactoring" into devel/master