First master commit
Some refactoring.
New functions in command module.
Fixed some bugs.