PDBnet function additions, refactoring, bug fixes.