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