Remove malloc() and small cleanup

Remove some buggy code.
Use double instead float in rd_simulator.h

Thanks to bobozata.
Change memory alignment for mesh.

A bit readable code (and maybe small slowdown).
Change parameter type to double.