Refactoring to further modularize each API. Also, commands can now be safely added during static init from any module in any order.