use position-bytes function to get the byte offset

The position-bytes function is the correct way to get byte offset for an
UTF-8 encoded source file. Probably, it still won't work for UTF-16 and
UTF-32, but at least it fixes the UTF-8.

Also, this pull makes the yasnippet dependency optional (which it really is).