Add resource files for unit tests. Code cleanup, added comments.