Significant revamp based on further implementation work done inside the Kobo iOS app. Thought I'd posted this ages ago...