[shadow channel]: copying the main file to an init.c

This is in preparation of creating an init() function to replace main(). Init will be called from python interfaces