Fix and cleanup

* Fixed the bugs introduced by my previous commit relating to the formatting function property name. Note that the existing fix to the bug I introduced does not fix the thing completely.
* Arranged indentation, which currently is totally messed up, aligning it with "standard" d3 code.

Despite several attempts, I could **not** setup my environment, so that I could test the proposed changes (CDA is breaking by some yet to be determined reason).
I did review the resulting code thoroughly to prevent any obvious bugs.

@pmalves please review.