Fix recent additions for GCC build

It wouldn't build for me without the forward declaration and `-fpermissive` requires namespace to not be declared within class definitions.