Major refactor of gem; Implemented config templates;