class library: improve readability by unifying code formatting.

No functional changes. Mostly just removing trainling semicolons, adding spaces between elements and newlines between methods. Generally, using the same syntax everywhere in one file. Later we can still change all the "arg x, y, z;" to |x, y, z|.