Relocated code defining allowed actions to a more logical place.
Eliminated $flagorder at main loop entering: not necessary.
Fixing up some comments
More comments and some minor fixings in code
Still more comments and some minor fixings in code. Mainly re-reading the code.
Don't get the uuid of next task if current is last. Solves Issue #5

When preparing next after acting with some command that can change the
list, can't proceed to the next task (trougth uuid) if current is last.
Merge branch 'Issue_5'