Move permission reset to later in the script

Move the permission reset after the creation of the database so
everything has the correct permissions.
WIP: add autoinstaller script

This script is intended to be used with Vagrant to bootstrap the entire
process.