Added comments for each function and login now returns at the end of the password list

Changes
======
- Added comments for each function describing what they do
- function login now returns at the end of the password list.
- function sreadl now return the size of the C string instead of always returning a 0