clean up some code
Add CRC checking upon login request, did some TODOs