Dictionary implementation and regression fixes. 

These bunch of submissions contain dictionary implementation and fixes for all regressions (the latest stable branch as the base line) that introduced by dictionary implementation && refactoring/code cleanup.