Fixed bugs in form and viewForm. Added new Tests for form

Signed-off-by: Alexander Book <redchrome@gmx.de>