Added: Lock on network requests.

Split network manager code in 2 files.