Added login and fixed some bugs.
Added STAT command