Separetes functions code

Create c files for each group (block, grid, well, memory,...)