Split client scripts into multiple files for easier editing.
Added workaround for socket closing after 60s.