improve php strictness
minor js tweak
improve print preview. Fixes #33