Use configobj's as_int instead of int()
Improve tweet retrieval

 - reduce duplication
 - combine WHERE clauses
 - use an iterator for reduced memory consumption