Implemented 'rebuild' command.  All major functions now working.