fail->panic
Reorganize and use type aliases to hide implementations.

1. Reorganize:
  a. Private modules for code organization
  b. Public modules for API organization
2. Use type aliases instead of custom iterators to hide implementation
   details.