Micromachined three-dimensional electrode arrays for in-vitro and in-vivo electrogenic cellular networks