Use scalariform to format the code.
Format code, add some ScalaDocs.