More refector of function files.

Continuing to move functions into seperate files in './lib/*'.

Move set_defaults(), menu_generate() and pretty_print().