Multiple changes

- Fixed some problems in the smart component reference.
- Optimizations and other minor changes and fixes in manager.
- Minor documentation updates.
- Added the first advanced example.