Added documentation and changed way of registering commands