Style fixes
More codestyle refactoring
Replace malloc with uint8 array objects