Make HyObject.replace more resilient

This makes it work on quoted objects