Add back crypt library for Linux.
Remove explicit to bandage return value issues.
Minor tidy up.
Refactor MySQL DB implementation.