splitting up matrix creation from api
work in progress. Starting implementation of grid class but ran into problems with calling conventions when loading from python/ctypes