Added .clang-format file and updated formatting of code.