Persistent remapping of the Caps Lock key

I have been annoyed by the standard way of (re)mapping the Caps Lock and Compose key for a very long time. Remapping is usually done using xmodmap, a tool that can be used to patch the current keymap in order to make the Caps Lock key behave like ESC ...