Use a better method for filename checking, move spec/ to correct location