PropertiesToJSON:
- improve readability & doc
- add arg checking