Add Makefile, move files around, fix tests