Re-added unit tests that were accidentally removed.
Ported the rest to use D style.