Make the application name snake cased when it contains spaces

Hello,

This pull request fixes the application name used to fill the `database.yml` and `session_store.rb` files ; previously, if the provided name contained whitespaces, it led to unexpected names in these files.

Since Shellwords.escape adds backslashes to escape spaces, the app_name should remove them and replace any space with an underscore (just like periods previously).

Also improve the assert_file helper to work with paths containing spaces using String#shellescape.

/cc @senny By the way, sorry, this patch fixes two problems but the solution is the same so I thought it was ok not to open another PR just for the provided test ; if you want to, let me know.

Have a nice day.