Fix a stupid bug in asap plugin.

Swap size and nmemb arguments to fread.
Add initial support for gzipped database.

May contain bugs. Still testing.