move templates to root, move test folders to match lib structure, improved guard rules