I decided to rewrite this in Lite-C and this is what I´ve got so far, but there is still a lot of space to make things better (not only the texturing :P).
It is just the generation at the moment: