Add "token extraction and manipulation" functions

+ functions
+ test (WTF - getLocationForOffset() crashes)
Merge remote-tracking branch 'origin/master'