Code Cleanup

Moved some macro declarations and function forward declarations into the
header file from the main file.