Add support for nested sub commands.

Use pull request #7 by @jd as the base.

- Allow `parent` parameter for the subcommand decorator.
- Use the metaclass to add the subcommands that have the `parent`
  attribute to the appropriate parent parser.

This must differ from pull request #7 in the following ways:

1. Avoid namespace pollution: Do not use staticmethod when a nested
   function is sufficient.
2. Avoid inheriting `subcommand` from `command` since the `main` command
   has special significance.
3. Separate the nested command test from the complex command tests.