Moved tools to phygen tools

Fixed a couplf of bugs in nexus reader and factory

Fixed a bug with the tools command line interface.