Added a simple write_level function to write our changes back to a file

Signed-off-by: Toon Schoenmakers <nighteyes1993@gmail.com>