Backend implementation.

The full backend implementation it's not yet finished but you can check out some tests.