Cleaning up the rest of the code and doing proper node exports