vector cleanup and turning ast::spanned into a struct

Just some code I have queued up in my repository I'd like to upstream. I'm converting all the `#[auto_encode]`ed code to use structs, so this is the first step. Plus it includes some vector cleanup and a function to partition vectors.