RFC position code

This is a stab at the position code. Any feedback welcome.

I need to at least clean it up and add more tests. Just want to make sure it's going down the right track.
Yeah that's much nicer. Current code does have an envy smell to it. Thanks.