Fix issue #130 and JUnit/Javadoc improvements

This code runs in Rx thread, so the assignment to fromCommand[0] is not properly published to the main thread. AtomicReference can be used to fix that.