Several changes in compiler structure

* Fixed HLSL compiler
* Moved and refactored smart pointer classes.