Refactored header files and makefile for bottomup as setup for topdown.