Remove checksum and convertIP functions from login.

Also start moving declarations to the top of the source file so that
they are easy to find (and replace).
Move includes and make minor CMakeLists style change.
Fix libtethealla variable export.

This was preventing the other targets from being built on their own.
Remove remaining NOSQL support.