Main features completed.
Code beautified.
TODO:
 * clean code;
 * test and squash bugs;
 * design trait scripts;