refactoring and adding unit tests

* Extracted IThreeGrid from ThreeGrid and updated relevant interfaces
* Added integer indexes to Position