use __attribute__((malloc)) in more places
cleanup project and add Makefile