Fix memory leaks
Makefile for building executables
Some initial docs