Scala user documentation

- added state machines
Java user documentation