Move generator code in a singleton
Add first unit test
Parameter 'size' in generateBlocks doesn't need substract