Add cstdlib
Add function prototypes
Add funcion stubs
Add needed structs
Add some initialiation calls in main