Added more tests.
Repaired visibleFields functionality.