Make level configuration more abstract. Closes #319

@narqo