Extended Bose Hubbard model of interacting bosonic atoms in optical lattices: From superfluidity to density waves