Implemented package handling.

Tracking and finding of packages.
Function to convert from resource to file and vice versa using our
package knowledge.
Interactive package adding and open dependency.

Function to open dependency when plugin supports this.
Function to register a package interactively.
Refactoring and cleanup of other parts.