Added socket close. Refactored. Commented.

AssyncTask now closes the socket. Refactored a lot
and added many comments.