The default goal is `all`
Use standard types in the OTP release.
Split the bucket handling code into a module of its own.

There is no reason to have the bucket code inside the code which handles the state tracking table.