Move shadow stuff into its own module.