Stylistic mash-ups

- Instead of setting properties to arbitrary big values, do it as the documentation advises: use `HUGE_VALF`
- removed some superfluous casts to improve readability
- use the better `arc4random()` instead of the bad and obsolete `rand()`
- fixed indentation, got rid of trailing WS