Update formatting, add unit-tests.