Many useful changes towards production

Please do not merge yet. For now this is to keep track.