Multi-state Markov and hidden Markov models in continuous time