Tidy up code for detecting significant whitespace
Make newlines before closing braces significant