Extracted form parsing to a separate library and adjusted form parser to use it. Added tests.