Adds cpu_reference_implementation to run.sh
Minor refactor and add -O2 to CFLAGS and CXXFLAGS

C++ Reference implementation now 10x quicker (?)