Added first code for scanner.c

Loads of bugs. Will be resolved.