I find that Mac keyboards are very difficult to remap. Is there any reason for that? Or maybe there's some utility that handles remapping I just can't find. Buggy as it is, I miss xmodmap.
You can remap the modifier keys (Caps Lock, Alt, Cmd) from the preferences pannel, in Keyboard. There's a button at the bottom, called "Modifier Keys..."
If you want to map something to ESC, try PCKeyboardHack: http://pqrs.org/macosx/keyremap4macbook/extra.html