Clean up root of the crate

Moved all the `#[cfg(window)]` and `#[cfg(headless)]` stuff to their own module.