added more flag support

* removed unnecessary "import stat"
* added support for installing file and -r (remove) flag