Adds Makefile.
Dynamically adjust buffer sizes based on project.
Fix record beyond end of file.
Optimisation: Use global buffers rather than create for each period.