Moved all imports into the ifndef guards to make compilation faster.