include cleanups: remove unused headers and add feature test macros