Using uint64_t instead of size_t
Removing a really strange function

Thanks to Lukas Prokop for this
Adding option for static compilation to cmake
Fixing a bug introduced with 0a40ce57082aea