Change from NIF to binary wrapper / Port

This is maybe slower but should be more stable related to
weird C lang issues (corrupted chunks while freeing memory).