initial split into multiple inc & src files, plus Makefile