Added uthash; cleaned up some code and macros