Implemented a script formatter and removed the damn ugly rests of mode.c