Modal forms have extra borders

When forms are launched in a modal dialog, they appear fine.
When launched into a new tab, they contain extra borders.
This patch removes the extra borders and small refactor.

Change-Id: I7bedb0e9496195e1201a538266f456bea4ba6160
Closes-Bug: #1386352
Merge "Modal forms have extra borders"