Move eproject stuff into own file.  Minor refactorings.