Fixes two little potentional bugs:

- $connection should be true or false, however mysql returns -1 in special cases. So it's better to check the type too to avoid any false positives
- import_firstpost should be an integer, so cast it to one
use replace_query to update our trackers instead of a hardcoded query
Fixed two bugs with PHP 5.2
WIP #140: Add avatar module

remove all old tries to merge avatars
Fixes #141: Remove testing functions
Merge remote-tracking branch 'upstream/feature' into old-modules