Start of complete re-write

Re-written basic functions to get to main menu.