Moved functions to C files and more include files (dynamic begins now)