Started library-base implementation (in js-core).
This is a complete redesign, that aims to separate the module into several parts:
core, simple templates, XML templates, HTML templates.
This commit incorporates the core.