Use a for loop for all mappings.
Simplify mapping commands a bit.
Fix tests and add todo items.