Code style. Some decomposition done.
Manual tests moved to the separate file.
Specification update.
Intermediate state.