Add favicon handling, open in new window, tidying code.