Improve resolution of inline dereferencing

* inline dereferencing is not only for definitions
* supports deep level inline dereferencing
added support for resolution of inline dereferencing with ~ or /