Removed unnecessary new lines that were inconsistent with the current formatting style.

This PR removes unnecessary new lines that do not comply with the current formatting style/code guide.

The current formatting style is to have 2 empty newlines between blocks of code and 1 empty newline between code within a block. This PR addresses areas where there were 3 empty newlines. There was only 29 instances of this in the code base excluding `*.md` files.