most of the work on simplifying map statements

Signed-off-by: Mattias Andrée <maandree@operamail.com>