Added dynamic blocks support.
Refactoring.
Added docs.