Hand-optimized a few things for better ASM output.
Added test program and build script.