m misc + most of the work for issue 106, except quote support

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