Moved defines, add ntwk

Moved defines to main.h
Added ntwk.c / ntwk.h