Make pkgnx lazy.

Add lazy loading support to pkgnx.

Please check my code and restyle/clean it up so it looks like you wrote it!