That would unfortunately not be possible out of the box right now. It would need to be custom build.
You just mention categories... what would be your use case? Would you just need to group a number of properties? Because you could just add an empty property that would just render your category heading.
If you would need to collapse groups that would be, as Dmitry mentioned, quite complex and not guaranteed to be future proof at this time.