Adds SPM support.
This is my first work with SPM; it seems like it has great potential, but is currently limited. I couldn't find a practical way to have iOS-specific files not compile for macOS with the manager, so there's some sad precompiler work in the iOS-specific files.