Switch from #define guards to #pragma once

As well as a few whitespace cleanups

This address #565.