Make building test binary an option

This adds an option to make building the test binary optional.