Clean up

Move all C and assembly code to source file. Removed unneeded externs.