Amdify and replace public API

The public API is based on the one used in gaia, but
the b2g specific bits are removed.