Redesigned code to prepar Stroke for a push request

Added a few comments, and hopefully this code (containing both old and
new versions) will be possible to push into the wild.