Refactored network code, made cleaner, better seperated  and more efficient.
Added comments for the knot_network.h file.