Refactor code

- Handle more complex json string which contain object and array
  in the same level
- Support more output options
- Remove the dependency on nixio for easier use