Some refactoring and comments
Another portion of comments and refactoring
Added doxyfile, also improved comments in core