Implemented dynamic quest table generation + minor refactoring.