How to sync position, bookmarks and notes over iCloud on ePub books

I finally got this working by signing out and signing in again in the iBookstore. It then asked me if I wanted to sync, I said yes, but it still didn't work, so I went to Settings and saw that the sync switches were off, and now it works. Phew!