Fix Pathname related issues
Fix options serialization by avoid duplicates and encoding options properly.
Add support for a `root` options, to expand sprites properly.