Adjust layout and code. Improve cross compatibility for SBT 0.11, 0.12, 0.13