Split out into a library as well as an executable