Segmentation faults in scanner.c resolved by major overhaul

Passed in an already initialized token from main through get_token,
thus ensuring that memory allocated was already there.