Correcting time of RDM running assertion plus minor changes

- Corrected the time when malinka checks if RDM
  is running and if not it makes sure it starts

- More work on json string escaping

- minor code refactoring