Fixed issue #2, issue #3, issue #4, issue #5, issue #6.
Regarding issue #3 and #4, the functionality was implemented such that, bringing to front or back will move the selected layer towards front or back of the immediate layer. Now this is changed as per the suggestion.