Moved prototype code into module

Made the code stricter when embedding alternative targets for a
readme.
Added .tmp to .gitignore [ci skip]