Fix #79 plus example code
Integrated most of the changes from https://github.com/mxab/cfsfileurl-example/commit/031e1dc114b9de25ad940916d79dbf0aa1e6d9b7.