Match MPD implementation and add tests