Complete refactoring + introduction of archetype

Signed-off-by: Antoine Neveux <antoine.neveux@gmail.com>