Size optimizations and other fixes

Testing functions are only built when TESTER is defined, which significantly reduces the final binary size.
Also fixed a type and wrapped C code with an extern.