Moved type merge related code to a separate file
Fixed Makefile, and make travis use “make spec”