Bug fixes on db/DooModelGen.php and added Memcached functionality