first pass at vector indexing functions.
Redone with indexing functions over raw vectors. Not finished, but this might work.