Merged the nix branch.
Merged nix branch.
Basic makefile and library changes.