m + add test client

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

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

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

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