Improve init command, various rewrites and layer command