Make modules fit for unit testing.
Format codes.
Socket header fix.
Fix some crashes.
Bugfixes.

- Wrong method comparation.
Add seed declaration comments.