Launchpad bug-1179630 Autodetect path search order

Please do not hesitate to criticize.

I don't understand the full breadth of what ultisnips does, so I may have missed some functionality that's important.

Also not 100% sure if the code here is well formed for fitting into the project or not.

Relates to our conversation over at https://bugs.launchpad.net/ultisnips/+bug/1179630